<template>
  <el-row :gutter="20">
    <el-col :span="8"  v-for="i in CardsData" style="padding-top: 10px">
      <CompanyCard
        :title="i.enterprise_name"
        :img_src="i.enterprise_website"
        :company_address="i.enterprise_address"
        :company_style="i.industry"
        :company_years="i.enterprise_website"
        :company_id="i.enterprise_infor_id"
      ></CompanyCard>
    </el-col>
  </el-row>
</template>

<script>
import CompanyCard from '../../../More/components/MoreMain/CompanyCard'
import axios from 'axios'

export default {
  name: 'MainCompany',
  components:{CompanyCard},
  data(){
    return{
      CardsData:[]
    }
  },
  created () {
    const _this=this
    axios.get('http://localhost:8080/get_enterprise_info_show')
      .then(function (response) {
        _this.CardsData=response.data
        if(_this.CardsData.length > 9){
          for (let i = 0 ; i < _this.CardsData.length-9 ; i = i + 1){
            _this.CardsData.pop()
          }
        }
        for (let i = 0 ; i < _this.CardsData.length ; i = i + 1){
          _this.CardsData[i].enterprise_website = 'http://' + _this.CardsData[i].enterprise_website
          // console.log(_this.CardsData[i].enterprise_website)
        }
      })
      .catch(function (error) {
        console.log(error);
      });
  }

}
</script>

<style scoped>

</style>

